package com.fegin.client.admin;

import com.fegin.Hystrix.admin.AdminContentNewsFeginHystrix;
import com.fegin.VO.admin.ContentNewsVO;
import com.fegin.bean.admin.ContentNews;
import com.fegin.common.ServerNameConstant;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Map;

/**
 * 新闻转发fegin
 *
 * @author 卫星
 * @package com.fegin.client.admin
 * @date 2019-03-05  14:42
 * @project CurrenCy-Cloud
 */
@FeignClient(value = ServerNameConstant.ADMIN_SERVER, fallbackFactory = AdminContentNewsFeginHystrix.class)
public interface AdminContentNewsFegin {
    /**
     * 新闻查看
     *
     * @param contentNews
     * @return
     */
    @RequestMapping(value = "/admin/news/view", method = RequestMethod.GET,
            consumes = MediaType.APPLICATION_JSON_VALUE)
    public Map<String, Object> view(@RequestBody ContentNews contentNews);

    /**
     * 分页查看数据
     */
    @RequestMapping(value = "/admin/news/newsList", method = RequestMethod.GET,
            consumes = MediaType.APPLICATION_JSON_VALUE)
    public Map<String, Object> newsList(@RequestBody ContentNewsVO contentNewsVO);

    /**
     * 删除数据
     *
     * @param contentNews
     * @return
     */
    @RequestMapping(value = "/admin/news/del", method = RequestMethod.GET,
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Map<String, Object> delNews(@RequestBody ContentNews contentNews);
}
